package com.sooth.common.dream.handler;

import com.dream.mate.logic.inject.LogicHandler;
import com.dream.system.config.MethodInfo;
import com.dream.system.table.TableInfo;
import com.sooth.common.dream.annotation.IgnoreLogic;

import java.lang.reflect.Method;

public class SoothLogicHandler implements LogicHandler {
    @Override
    public boolean isLogic(MethodInfo methodInfo, TableInfo tableInfo) {
        boolean ignoreLogic = false;
        Method method = methodInfo.getMethod();
        if (method != null) {
            ignoreLogic = method.getAnnotation(IgnoreLogic.class) != null;
        }
        return !ignoreLogic && LogicHandler.super.isLogic(methodInfo, tableInfo);
    }

    @Override
    public String getLogicColumn() {
        return "del_flag";
    }
}
